package com.otitan.la.forest.system.controller;

import com.otitan.la.forest.system.dto.PermissionRoleDTO;
import com.otitan.la.forest.system.service.PermissionRoleService;
import com.otitan.webapp.framework.basepro.model.DataResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @Description:    动作
 * @Author:        Sunke
 * @CreateDate:     2020/9/24 0024 16:12
 * @UpdateUser:     Sunke
 * @UpdateDate:     2020/9/24 0024 16:12
 * @UpdateRemark:   修改内容
 * @Version:        1.0
 */
@Slf4j
@Api(tags = "动作角色API")
@RestController
@RequestMapping("/permission/role")
public class PermissionRoleController {


    @Autowired
    private PermissionRoleService permissionRoleService;


    @ApiOperation(value = "动作权限设置")
    @PostMapping()
    public DataResult add(@Valid @RequestBody PermissionRoleDTO permissionRoleDTO, BindingResult bindingResult) {
        return permissionRoleService.add(permissionRoleDTO, bindingResult);
    }

}
